package cn.hackcloud.controller;

import cn.hackcloud.dto.Result;
import cn.hackcloud.dto.UserVo;
import cn.hackcloud.rpc.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/user/get/{id}")
    public Result<UserVo> get(@PathVariable int id) {
        return userService.get(id);
    }

    @GetMapping("/user/list")
    public Result<List<UserVo>> get() {
        return userService.get();
    }
}
